<template>
  <!-- 自定义头部导航栏组件 -->
  <view class="nav-bar">
    <view class="com-nav-bar" :style="{ paddingTop: top + 'px', height: height + 'px' }">
      <view class="title">
        <text>{{ title }}</text>
      </view>
      <view class="search" @click="goSearch">
        <uni-icons type="search" size="20" color="#888"></uni-icons>
        <text class="text">搜索</text>
      </view>
    </view>
    <view class="fill" :style="{ height: top + height + 'px' }"></view>
  </view>
</template>


<script lang="ts" setup>
import { getMenuInfo } from '@/utils/utils';

// 
const props = defineProps({
  title: {
    type: String,
    default: "标题"
  }
});

// 
let top = getMenuInfo().top;
let height = getMenuInfo().height;

// 
const goSearch = () => {
  uni.navigateTo({
    url: `/pages/pkgB/search/index`
  })
};
</script>


<style lang="scss" scoped>
@use "style.scss";
</style>